package kr.ac.kaist.savehearts.auth;

import java.util.HashSet;

/**
 * UserInfo class describes user information required for the service
 * It contains user's last name, first name, email, phone number, location (latitude and longitude), and id.
 * Those values can be acquired from the user's facebook account, user location information, and 
 * a telephony service.
 * For more information about facebook authentication, please refer to
 * 		kr.ac.kaist.savehearts.auth.FacebookConnection
 * For more information about user location information, please refer to
 * 		kr.ac.kaist.savehearts.location.UserLocationTracker
 * For more information about telephony service
 * 		android.telephony.TelephonyManager
 * @author Seungwook Han (hsw1120@gmail.com)
 */

public class UserInfo {
	
	/**
	 * Tag for debugging
	 */
	private static final String TAG = UserInfo.class.getSimpleName();
	
	/**
	 * ID of the user
	 */
	private String id;
	public String getId() { return this.id; }
	public void setId(String id) { this.id = id; }
	
	/**
	 * Full name of the user (can be a nickname)
	 */
	private String fullName;
	public String getFullName() { return this.fullName; }
	public void setFullName(String fullName) { this.fullName = fullName; }
	
	/**
	 * Last name of the user
	 */
	private String lastName;
	public String getLastName() { return this.lastName; }
	public void setLastName(String lastName) { this.lastName = lastName; }
	
	/**
	 * First name of the user
	 */
	private String firstName;
	public String getFirstName() { return this.firstName; }
	public void setFirstName(String firstName) { this.firstName = firstName; }
	
	/**
	 * E-mail address of the user
	 */
	private String email;
	public String getEmail() { return this.email; }
	public void setEmail(String email) { this.email = email; }
	
	/**
	 * URL of profile picture
	 */
	private String pictureUrl;
	public String getPictureUrl() { return this.pictureUrl; }
	public void setPictureUrl(String url) { this.pictureUrl = url; }
	
	/**
	 * Current longitude (location) of the user
	 */
	private double longitude;
	public double getLongitude() { return this.longitude; }
	public void setLongitude(double longitude) { this.longitude = longitude; }
	
	/**
	 * Current latitude (location) of the user
	 */
	private double latitude;
	public double getLatitude() { return this.latitude; }
	public void setLatitude(double latitude) { this.latitude = latitude; }
	
	/**
	 * Phone number of the user
	 */
	private String phoneNumber;
	public String getPhoneNumber() { return this.phoneNumber; }
	public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; }
	
	/**
	 * Set of neighboring users that is retrieved from the server
	 */
	private HashSet<UserInfo> neighbors;
	public HashSet<UserInfo> getNeighbors() { return this.neighbors; }
	
	public UserInfo() {
		// all fields are null or 0.0
		this.neighbors = new HashSet<UserInfo>();
	}
	
	public UserInfo(String id, String lastName, String firstName, 
			String fullName, String email, String pictureUrl) {
		this.id = id;	this.email = email;
		this.lastName = lastName;	this.firstName = firstName;
		this.fullName = fullName;	this.pictureUrl = pictureUrl;
		this.neighbors = new HashSet<UserInfo>();
	}
}
